From 54cc1d1b1e1d65469cb51d97f340d29f579b7d92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Mon, 25 Sep 2017 20:33:17 +0200 Subject: [PATCH] tests: use a epsilon instead of == for float compare --- tests/grayscale_to_rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/grayscale_to_rgb.c b/tests/grayscale_to_rgb.c index 7da0c86..b239e23 100644 --- a/tests/grayscale_to_rgb.c +++ b/tests/grayscale_to_rgb.c @@ -59,7 +59,7 @@ test (void) for (i = 0; i < PIXELS * 3; i++) { - if (rgb_buf[i] != rgb_buf_ref[i]) + if (fabs (rgb_buf[i] - rgb_buf_ref[i]) > 0.0000001) { babl_log ("index %i is problematic : %f instead of %f", i, rgb_buf[i], rgb_buf_ref[i]); -- 2.30.2